home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_asps4egj.asp < prev    next >
Encoding:
Text File  |  1999-07-29  |  4.0 KB  |  69 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <HTML>
  3. <HEAD>
  4. <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
  5. <TITLE>Server-Side Includes</TITLE>
  6. <SCRIPT LANGUAGE="JavaScript">
  7. <!--
  8.     TempString = navigator.appVersion
  9.     if (navigator.appName == "Microsoft Internet Explorer"){    
  10. // Check to see if browser is Microsoft
  11.         if (TempString.indexOf ("4.") >= 0){
  12. // Check to see if it is IE 4
  13.             document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
  14.         }
  15.         else {
  16.             document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
  17.         }
  18.     }
  19.     else if (navigator.appName == "Netscape") {                        
  20. // Check to see if browser is Netscape
  21.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
  22.     }
  23.     else
  24.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
  25. //-->
  26. </script>
  27. <SCRIPT LANGUAGE="VBScript">
  28. <!--
  29. Sub Window_OnLoad()
  30.    Dim frmContents
  31.    On Error Resume Next
  32.    If Not Parent Is Nothing Then
  33.       Set frmContents = Parent.Contents
  34.       If Not frmContents Is Nothing Then
  35.             frmContents.Window.TOCSynch_Click
  36.       End If
  37.    End If
  38. End Sub
  39. //--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
  40. <META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
  41. <META NAME="MS.LOCALE" CONTENT="EN-US">
  42. <META NAME="MS-IT-LOC" Content="Internet Information Services"> 
  43. </HEAD>
  44.  
  45. <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
  46.  
  47. <H2><A NAME="_server_side_includes"></A><SUP> <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/asp/asps4egj.asp&srcfile=Simple/Includes" %></SUP>Server-Side Includes</H2>
  48.  
  49. <H6>Overview</H6>
  50.  
  51. <P>Modularity and reusability of code can be very useful in your development of ASP scripts. For example, if you want to display copyright information on the bottom of each of your HTML pages and ASP pages, ASP provides a solution to this problem: server-side includes, which are directives to the server to include a certain file, which can be a text file, graphical image, or an ASP function. The copyright notice can exist as one file, and be included into the rest of your Web site's files. And if the copyright notice changes, you only have to change one file instead of 50 or 500.</P>
  52.  
  53. <P>The syntax for including a file is:</P>
  54.  
  55. <PRE><CODE><!-- #include PathType=Name -->
  56. </CODE></PRE>
  57.  
  58. <P>The <I>PathType</I> parameter consists of a keyword, either FILE or VIRTUAL, which indicates whether the <I>Name</I> string specified is a physical or virtual path. </P>
  59.  
  60. <H6>Code Tour</H6>
  61.  
  62. <P>This example uses the <B>#include</B> directive to include the file HeaderInfo.asp. When this script is executed, ASP loads the script line by line, character by character, until it gets to the <B>#include</B> directive, at which point it loads the contents of the designated file, line by line. Then the remainder of the sample script is loaded; once this is finished the script is executed, included file and all. </P>
  63.  
  64. <P><B><B>Note   </B></B>If the file that your ASP script includes contains a large number of functions and variables that are not used by the including script, the extra resources occupied by these unused structures can adversely affect performance, and ultimately decrease the scalability of your Web application. Therefore, it is generally advisable to break your include files into multiple smaller files, and include only those files required by your ASP script, rather than include one or two larger include files that may contain unneeded information.</P>
  65. <hr class="iis" size="1">
  66. <p align="center"><em><a href="../../../common/colegal.htm">© 1997-1999 Microsoft Corporation. All rights reserved.</a></em></p>
  67. </BODY>
  68. </HTML>
  69.